#include "Comm.hpp"


int main()
{
    // 1.create key
    key_t k = ::ftok(gpath.c_str(),gprojId);
    if(k < 0)
    {
        std::cerr << "ftok error" << std::endl;
        return 1;
    }

    // 2.create share memory && get
    int shmid = ::shmget(k, gshmsize, IPC_CREAT | IPC_EXCL);
    if(shmid < 0)
    {
        std::cerr << "shmget error" << std::endl;
        return 2;
    }
    std::cout << "shmid: " << shmid << std::endl;

    // 3.delete shm
    shmctl(shmid,IPC_RMID,nullptr);

    return 0;
}